import { ViewHelper as ViewHelperBase } from "three/examples/jsm/helpers/ViewHelper.js";
class ViewHelper extends ViewHelperBase {
  panel;
  constructor(editorCamera, container) {
    super(editorCamera, container);

    this.panel = document.createElement("div");
    this.panel.style.cssText = `position: absolute; bottom: 0; right: 0; z-index: 33; width: 128px; height: 128px`;

    container.style.position = "relative";
    container.appendChild(this.panel);

    this.panel.addEventListener("pointerup", this.onPointerup.bind(this));
    this.panel.addEventListener("pointerdown", this.onPointerdown.bind(this));
  }

  onPointerup(event) {
    event.stopPropagation();
    this.handleClick(event);
  }

  onPointerdown(event) {
    event.stopPropagation();
  }
}

export { ViewHelper };